<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_user.*,com.lmpop.trade.ti_member.*,com.lmpop.trade.ti_memreport.*,com.lmpop.trade.ti_personal.*,com.lmpop.trade.ti_goods.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%
	request.setCharacterEncoding("UTF-8");
	Hashtable ti_memreport = new Hashtable();

	String _deal_state = "",_start_date="",_end_date="";

	if(request.getParameter("deal_state")!=null && !request.getParameter("deal_state").equals("")){
		_deal_state = request.getParameter("deal_state");
		ti_memreport.put("deal_state",_deal_state);
	}
		if(request.getParameter("s_start_date")!=null && !request.getParameter("s_start_date").equals("")){
		_start_date = request.getParameter("s_start_date");
		ti_memreport.put("start_date",_start_date);
	}	
	if(request.getParameter("s_end_date")!=null && !request.getParameter("s_end_date").equals("")){
		_end_date = request.getParameter("s_end_date");
		ti_memreport.put("end_date",_end_date);
	}
	
		//Ti_customerInfo ti_customerInfo=new Ti_customerInfo();
	    Ti_memberInfo memberInfo = new Ti_memberInfo();
		Ti_personalInfo ti_personalInfo = new Ti_personalInfo();
		Ti_userInfo userInfo = new Ti_userInfo();
		Ti_goodsInfo ti_goodsInfo = new Ti_goodsInfo();
	
	Ti_memreportInfo ti_memreportInfo = new Ti_memreportInfo();
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ti_memreportInfo.getListByPage(ti_memreport,Integer.parseInt(iStart),limit);
	int counter = ti_memreportInfo.getCountByObj(ti_memreport);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?deal_state="+_deal_state+"&start_date="+_start_date+"&s_end_date="+_end_date+"&iStart=",Integer.parseInt(iStart),limit);
	
	String para ="deal_state="+_deal_state+"&start_date="+_start_date+"&s_end_date="+_end_date+"&iStart="+Integer.parseInt(iStart);
	
%>
<html>
  <head>
    
    <title>举报信息查看</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/commen.js"></script>
	<script type="text/javascript" src="js_report.js"></script>
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="90%">
				<h1>举报信息查看</h1>
			</td>
		</tr>
	</table>
	
	<form action="index.jsp" name="indexForm" method="post">
	<table width="100%" cellpadding="0" cellspacing="0" class="dl_su">
		<tr>
			<td align="left" >
		
					&nbsp;按处理状态:
				<select name="deal_state">
					<option  value="">请选择</option>	
						<option  value="1">已处理</option>	
							<option  value="0">未处理</option>	
				</select>
				
				&nbsp;按时间段:
									
						    <input name="s_start_date" type="text" id="s_start_date" class="Wdate" value="" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'s_end_date\',{d:-1})}',readOnly:true})" size="15"  width="150px"/>
              -
	          <input name="s_end_date" id="s_end_date" type="text" class="Wdate" value="" onclick="WdatePicker({minDate:'#F{$dp.$D(\'s_start_date\',{d:1})}',readOnly:true})" size="15" width="150px"/>
 
		<input name="searchInfo" type="button" value="搜索" onclick="searchForm();" />	
			</td>
		</tr>
	</table>

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<input type="button" name="delInfo" onclick="delIndexInfo()" value="删除" class="buttab"/>
			</td>
			<td>
				共计:<%=counter %>条
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
			<th width="5%" align="center"><input type="checkbox" name="checkall" id="checkall" onclick="selectAll()"></th>
			
		  	<th>会员名称</th>
		  	
		  	<th>被举报企业</th>
		  	
		  		<th>商品名称</th>
		  	
		  	<th>处理状态</th>
		  	
		  		<th>举报时间</th>
		  		
			<th width="10%">查看/修改</th>
	  		<th width="10%">删除</th>
		</tr>
		
		
		<% 
		  		for(int i=0;i<list.size();i++){
		  			Hashtable map = (Hashtable)list.get(i);
		  			String info_id="",user_id="",goods_id="",cust_id="",content="",in_date="",deal_state="",deal_user_id="",deal_date="",deal_result="";
	  			  	String cust_name="",user_name="",__deal_state="",goods_name="";
	  			  	if(map.get("info_id")!=null) info_id = map.get("info_id").toString();
				  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
				  	if(map.get("goods_id")!=null) goods_id = map.get("goods_id").toString();
				  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
				  	
				  	// cust_name =	ti_customerInfo.getCustNameByCustId(cust_id);
				  	
				  	//user_name=ti_personalInfo.getPersonalNameByPersonalId(user_id);
				  	List lists = userInfo.getListByPk(user_id);
				  	if(lists.size() > 0){
					  	  Map maps = (Map)lists.get(0);
					  	  String cust_ids = maps.get("cust_id").toString(); 
					  	  if(cust_ids !=null) {
					  	      user_name = memberInfo.getCustNameByPk(cust_ids);
					  	  }
				  	 }
				  	
				 	goods_name=ti_goodsInfo.getGoodsNameById(goods_id);
				  	
				  	if(map.get("content")!=null) content = map.get("content").toString();
				  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
							if(in_date.length()>19)in_date=in_date.substring(0,19);
				  	if(map.get("deal_state")!=null) deal_state = map.get("deal_state").toString();
				  	
				  	  		__deal_state=deal_state;
				  	if(deal_state.equals("0")) deal_state="未处理";
				  	 	if(deal_state.equals("1")) deal_state="已处理";
				  	
				  	if(map.get("deal_user_id")!=null) deal_user_id = map.get("deal_user_id").toString();
				  	if(map.get("deal_date")!=null) deal_date = map.get("deal_date").toString();
							if(deal_date.length()>19)deal_date=deal_date.substring(0,19);
				  	if(map.get("deal_result")!=null) deal_result = map.get("deal_result").toString();

		  %>
		
		<tr>
			<td width="5%" align="center"><input type="checkbox" name="checkone<%=i %>" id="checkone<%=i %>" value="<%=info_id %>" /></td>
			
		 		<td><a href="updateInfo.jsp?info_id=<%=info_id %>"><%=user_name%></a></td>
		  	
		  	<td><%=cust_name%></td>
		  	
		  	<td><%=goods_name%></td>
		  	
  	<td><a href="index.jsp?deal_state=<%=__deal_state%>"><%=deal_state%></a></td>
		  	
		  	<td><%=in_date%></td>
		  	
			<td width="10%"><a href="updateInfo.jsp?info_id=<%=info_id %>&<%=para%>"><img src="/program/admin/images/edit.gif" title="<%if(__deal_state.equals("0"))out.print("修改");else out.print("查看");%>" /></a></td>
	  		<td width="10%"><a href="javascript:deleteOneInfo('<%=info_id%>','4607');"><img src="/program/admin/images/delete.gif" title="删除" /></a></td>
		</tr>
		
		  <%
		  		}
		  %>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<input type="button" name="delInfo" onclick="delIndexInfo()" value="删除" class="buttab"/>
			</td>
			<td>
				共计:<%=counter %>条
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<%
		 }
	%>
	
	  <input type="hidden" name="listsize" id="listsize" value="<%=listsize %>" />
	  <input type="hidden" name="pkid" id="pkid" value="" />
	  <input type="hidden" name="bpm_id" id="bpm_id" value="4607" />
	  </form>
</body>

</html>
